Release 10.1A: OpenEdge Data Management:
DataServer for ORACLE
RUN STORED-PROCEDURE statement
The
RUN STORED-PROCstatement runs an RDBMS stored procedure or allows you to send PL-SQL to an ORACLE Server based data source using an OpenEdge DataServer. It contains aprocedure-namewhich is either the:LOAD-RESULT-INTO phrase
The
LOAD-RESULT-INTOfunction loads the result set into a temp-table only where <handle> is a variable of type handle. Note that handle can also be defined as extent to enable you to pass more than one temp-table handle in those instances where the SQL statement is defined to return more than one result set.When used with the send-sql-statement or stored procedure to load a result set into a Progress temp-table, this function carries an implicit
Note: The Progress client issues an error at runtime if the variable of type handle with theCLOSE-STORED PROCEDUREstatement. However, the use of this function is optional so existing applications will not be affected.LOAD-RESULT-INTOfunction does not point to a temp-table.When used with the
LOAD-RESULT-INTOphrase, the temp-table handle identifies the temp-table to which the result set will be loaded.You can specify an array of one or more temp-table handle elements to retrieve stored procedure result sets and have the DataServer load the result set data directly into the associated temp-table(s). This approach allows you to have direct access to the fields defined in the temp-table.
The following types of temp-tables can support result sets:
For additional details about using the
LOAD-RESULT-INTOphrase with the temp-table handle, see the "Loading a result set into a temp-table" section.PROC-STATUS phrase
The
PROC-STATUSphase returns the return status from an ORACLE Server stored procedure. The return status is an integer value that indicates whether a stored procedure succeeded or failed; if it failed, a code indicating why it failed. See your ORACLE DataServer documentation for descriptions of the possible values for the return status.PROC-HANDLE phrase
The
PROC-HANDLEphrase allows you to specify a handle to act as a unique identifier for an ORACLE DataServer stored procedure. For example, thePROC-HANDLEassigns a value to the specified integer field or variable (integer–field) that uniquely identifies the:Note these additional points about the
PROC-HANDLE:NO-ERROR option
The
Note: This option must appear before any runtime parameter list.NO-ERRORoption specifies that anyERRORcondition that theRUNSTORED–PROCEDUREstatement produces is suppressed. Before you close a stored procedure, check theERROR–STATUShandle for information on any errors that occurred. You receive an error when you attempt to close a stored procedure that did not start.PARAM phrase
The
Paramphrase identifies a run-time parameter to be passed to the stored procedure. Aparameterhas the following syntax:
An
expressionis a constant, field name, variable name, or expression.INPUTis the default.OUTPUTandINPUT–OUTPUTparameters must be record fields or program variables.If you run
Note: The ORACLE DataServer only supports one SQL statement with the send-sql-statement option.send–sql–statementfor an ORACLE-based data source, you must pass a single character expressionparametercontaining the SQL statement you want the data source to execute.If you do not specify
parameter–name(the name of a keyword parameter defined by the stored procedure), you must supply all of the parameters in correct order. If you do specifyparameter–name, you must precede your assignment statement with the keywordPARAM. If you do not supply a required parameter, and no default is specified in the stored procedure, you receive a run-time error.
|
Copyright © 2005 Progress Software Corporation www.progress.com Voice: (781) 280-4000 Fax: (781) 280-4095 |